﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Main.master" AutoEventWireup="true" CodeBehind="Lop.aspx.cs" Inherits="WTSQCB.Lop" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <p>
        &nbsp; Quản lý lớp</p>
    <p>
        &nbsp;
        Hệ đào tạo:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="HeDaoTaoDropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="TenHeDaoTao" DataValueField="MaHeDaoTao" TabIndex="1" Width="150px">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Trình độ:&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="TrinhDoDropDownList2" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource2" DataTextField="TenTrinhDo" DataValueField="MaTrinhDo" TabIndex="2" Width="150px">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </p>
    <p>
        &nbsp;
        Chuyên ngành:&nbsp;
        <asp:DropDownList ID="ChuyenNganhDropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3" DataTextField="TenChuyenNganh" DataValueField="MaChuyenNganh" TabIndex="3" Width="150px">
        </asp:DropDownList>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Đại đội:&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:DropDownList ID="DaiDoiDropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource4" DataTextField="TenDaiDoi" DataValueField="MaDaiDoi" TabIndex="4" Width="150px">
        </asp:DropDownList>
    </p>
    <p>
        &nbsp;
        Danh sách:</p>
    <p>
        <asp:GridView ID="LopGridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" BackColor="White" BorderColor="#3366CC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource5" OnSelectedIndexChanged="GridView1_SelectedIndexChanged" DataKeyNames="MaLop" Width="980px">
            <Columns>
                <asp:CommandField ButtonType="Button" SelectText="CHỌN" ShowSelectButton="True" />
                <asp:BoundField DataField="MaLop" HeaderText="Mã lớp" SortExpression="MaLop" ReadOnly="True" />
                <asp:BoundField DataField="TenLop" HeaderText="Tên lớp" SortExpression="TenLop" />
                <asp:BoundField DataField="KhoaHoc" HeaderText="Khóa học" SortExpression="KhoaHoc" />
                <asp:BoundField DataField="NamThanhLap" HeaderText="Năm thành lập" ReadOnly="True" SortExpression="NamThanhLap" />
                <asp:BoundField DataField="TenHeDaoTao" HeaderText="Hệ đào tạo" SortExpression="TenHeDaoTao" />
                <asp:BoundField DataField="TenTrinhDo" HeaderText="Trình độ" SortExpression="TenTrinhDo" />
                <asp:BoundField DataField="TenChuyenNganh" HeaderText="Chuyên nganh" SortExpression="TenChuyenNganh" />
                <asp:BoundField DataField="TenDaiDoi" HeaderText="Đại đội" SortExpression="TenDaiDoi" />
            </Columns>
            <FooterStyle BackColor="#99CCCC" ForeColor="#003399" />
            <HeaderStyle BackColor="#003399" Font-Bold="True" ForeColor="#CCCCFF" />
            <PagerStyle BackColor="#99CCCC" ForeColor="#003399" HorizontalAlign="Left" />
            <RowStyle BackColor="White" ForeColor="#003399" />
            <SelectedRowStyle BackColor="#009999" Font-Bold="True" ForeColor="#CCFF99" />
            <SortedAscendingCellStyle BackColor="#EDF6F6" />
            <SortedAscendingHeaderStyle BackColor="#0D4AC4" />
            <SortedDescendingCellStyle BackColor="#D6DFDF" />
            <SortedDescendingHeaderStyle BackColor="#002876" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="LopLoad" SelectCommandType="StoredProcedure">
            <SelectParameters>
                <asp:ControlParameter ControlID="HeDaoTaoDropDownList1" Name="mahedaotao" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="TrinhDoDropDownList2" Name="matrinhdo" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="ChuyenNganhDropDownList1" Name="machuyennganh" PropertyName="SelectedValue" Type="String" />
                <asp:ControlParameter ControlID="DaiDoiDropDownList1" Name="madaidoi" PropertyName="SelectedValue" Type="String" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;
        <asp:Button ID="ThemButton1" runat="server" OnClick="ThemButton1_Click" Text="THÊM" Width="80px" />
        &nbsp;
        <asp:Button ID="SuaButton2" runat="server" OnClick="SuaButton2_Click" Text="SỬA" Width="80px" />
        &nbsp;
        <asp:Button ID="XoaButton3" runat="server" OnClick="XoaButton3_Click" Text="XÓA" OnClientClick="return confirm('Bạn có muốn XÓA không ?')" Width="80px"/>
    </p>
    <p>
        &nbsp;
        Thông tin chi tiết:</p>
    <p>
        &nbsp;
        Mã lớp:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="MaLopTextBox1" runat="server" Width="150px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="MaLopTextBox1" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Mã lớp không được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Tên lớp:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
        <asp:TextBox ID="TenLopTextBox2" runat="server" Width="150px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="TenLopTextBox2" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Tên lớp không được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Khóa học:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;
        <asp:TextBox ID="KhoaHocTextBox3" runat="server" Width="150px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="KhoaHocTextBox3" ErrorMessage="RequiredFieldValidator" ForeColor="Red">Khóa học không được để trống</asp:RequiredFieldValidator>
    </p>
    <p>
        &nbsp;
        Ngày:
        <asp:DropDownList ID="ddlNgay" runat="server">
        </asp:DropDownList>
&nbsp; Tháng:
        <asp:DropDownList ID="ddlThang" runat="server">
        </asp:DropDownList>
&nbsp;Năm:
        <asp:DropDownList ID="ddlNam" runat="server">
        </asp:DropDownList>
    </p>
    <p>
        <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT [MaDaiDoi], [TenDaiDoi] FROM [DaiDoi]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT [MaChuyenNganh], [TenChuyenNganh] FROM [ChuyenNganh]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT * FROM [TrinhDoDaoTao]"></asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:WebDiemTSQCBConnectionString %>" SelectCommand="SELECT * FROM [HeDaoTao]"></asp:SqlDataSource>
    </p>
</asp:Content>
